<?php
namespace app\shop\controller;

use think\Request;
use think\Controller;
use app\shop\model\Area as AreaModel;

class Area extends Controller
{
    // 地区三级联动
    public function set_area(Request $request, AreaModel $area)
    {

        if ($request->isPost()) {
            $cityId = $request->param('id');

            $areas = $area->where('area_parent_id', $cityId)->field('area_id,area_name')->order('area_sort desc')->select();


            return $areas;
        }
    }
}